package com.ABdolphin.forum.dao;

import com.ABdolphin.forum.model.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MessageMapper {
    int insert(Message record);

    int insertSelective(Message record);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message record);

    int updateByPrimaryKey(Message record);

    /**
     * 获得未读站内信数量
     * @param receiveUserId 用户自身id(站内信接受者id)
     * @return
     */
    Integer selectUnreadCount (@Param("receiveUserId") Long receiveUserId);

    /**
     * 获得用户的站内信列表
     * @param receiveUserId 用户自身id
     * @return
     */
    List<Message> selectByReceiveUserId(@Param("receiveUserId") Long receiveUserId);
}